﻿using FriendAnalyzer.Infrastructure.MachineLearning.Analysis;
using FriendAnalyzer.Infrastructure.MachineLearning.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tests
{
    class Program
    {
        static void Main(string[] args)
        {
            var data = new UserFeatures[] {
                new UserFeatures 
                {
                    UserId = 1,
                    Features = new double[] { 2, 3 },
                },
                new UserFeatures 
                {
                    UserId = 2,
                    Features = new double[] { 3, 4 },
                },
                new UserFeatures 
                {
                    UserId = 3,
                    Features = new double[] { 15, 14 },
                },
                new UserFeatures 
                {
                    UserId = 4,
                    Features = new double[] { 14, 15 },
                },
                new UserFeatures 
                {
                    UserId = 5,
                    Features = new double[] { 16, 17 },
                },
                new UserFeatures 
                {
                    UserId = 6,
                    Features = new double[] { 18, 19 },
                },
                new UserFeatures 
                {
                    UserId = 7,
                    Features = new double[] { 20, 19 },
                },
                new UserFeatures 
                {
                    UserId = 8,
                    Features = new double[] { 16, 19 },
                }
            };

            var userClassifier = new FacebookUserClassifier(data, 2);
            userClassifier.Fuzzyness = 2;
            userClassifier.Accuracy = 0.0000002;
            userClassifier.MaxStepCount = 200;
            userClassifier.Compute(true);

            var result = userClassifier.GetGroupedUsers();

            Console.ReadKey();
        }
    }
}
